<?php

namespace app\api\controller\mox;

use app\common\controller\Api;
use app\admin\model\mox\inherit\Policy as PolicyModel;

/**
 * 价值
 */
class Policy extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     * 价值列表
     *
     */
    public function list()
    {
        $model = new PolicyModel();
        $list = $model->order('id desc')
            ->paginate();
        $this->success('请求成功', $list);
    }
    /**
     * 详情
     *
     */
    public function detail()
    {
        $id = $this->request->param('id');
        $model = new PolicyModel();
        $row = $model->with(['user'])->where($model->getTable() . '.id', $id)->find();
        $this->success('请求成功', $row);
    }
}
